package com.csdj.springboottest.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;

/**
 * author:cloud
 * date:2021/4/22 0022
 **/
public class RedisMsgReceiver extends MessageListenerAdapter {

    private Logger log = LoggerFactory.getLogger("redis receiver");
    @Override
    public void onMessage(Message message, byte[] pattern) {
//        super.onMessage(message, pattern);
        log.info(new String(message.getBody()));
    }
}
